<div class="ibox">
	<div class="ibox-content">
		<form class="form-horizontal" id="editForm"
			action="${cxt!}/cms/article/update" method="POST">
			<input type="hidden" id="articleid" name="article.id" value="${article.id!}">
			<div class="form-group">
				<label for="namebasic" class="col-md-2 control-label">${_res["article.title"]}<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-3 ">
					<input type="text" class="form-control" name="article.title" value="${article.title!}" placeholder="${_res['article.title']}"
						required aria-required="true">
				</div>

				<label for="partentInputId" class="col-md-2 control-label">${_res["article.classification"]}<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-md-3">
					<!-- 父菜单id，从modal中获取 -->
					<input type="text" class="form-control" id="catalogName" value="${article.catalog.name!}" placeholder="${_res['article.parentMenu']}" 
					 data-toggle="modal" data-target="#myModal"> 
					<input type="hidden" name="article.catalogid" value="${article.catalogid!}" id="catalogid" required aria-required="true" />
				</div>
			</div>
			<div class="hr-line-dashed"></div>

			<div class="form-group">
				<label class="col-sm-2 control-label">${_res["article.status"]}<span class="fontColorRed">&nbsp;*</span></label>
				<div class="col-sm-3">
					<#dict type="select" class="form-control" name="article.status" dictCode="COMMON_STATUS" value="${article.status!}" required="true" />
				</div>

				<label for="namebasic" class="col-md-2 control-label">${_res["article.articleWeight"]}</label>
				<div class="col-md-3">
					<input type="text" class="form-control" name="article.priority" value="${article.priority!}" placeholder="${_res['article.articleWeight']}" number="true">
				</div>
			</div>
			<div class="hr-line-dashed"></div>

			<script id="container" name="article.content" type="text/plain" style="width:100%; min-height:500px !important">
              ${article.content!}			
			</script>
			
			<div class="hr-line-dashed"></div>
			
			<div class="form-group">
				<div class="row">
					<div class="col-md-10 col-md-offset-2">
						<% if(hasPrivilegeUrl("articleList")){ %>
						<button type="button" class="btn btn-warning" onClick="ajaxContent('/cms/article/list')">${_res["system.return"]}</button>
						<% } %>
						<% if(hasPrivilegeUrl("articleAdd")){ %>
						<button type="submit" class="btn btn-primary">${_res["system.save"]}</button>
						<% } %> 
						<% if(hasPrivilegeUrl("articleList")){ %>
						<button type="button" class="btn btn-danger" onClick="ajaxContent('/cms/article/list')">${_res["system.cancel"]}</button>
						<% } %>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<#submit formId="editForm" divId="content" /> <#nav />

<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
	aria-labelledby="myModaLabel">
	<form class="form-horizontal">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModaLabel">${_res["article.parentMenu"]}</h4>
				</div>
				<div class="modal-body">
					<%include("selectPartentNode.html"){}%></div>
					
				<div class="form-group">
					<div class="row">
						<div class="col-md-6">
							<label class="col-md-12 control-label "> 
							<% if(hasPrivilegeUrl("articleList")){ %>
						        <button type="button" class="btn btn-warning" data-dismiss="modal">${_res["system.return"]}</button>
				            <% } %>
					        
					      	<% if(hasPrivilegeUrl("articleList")){ %>
						        <button type="button" class="btn btn-primary" data-dismiss="modal">${_res["system.save"]}</button>
				            <% } %>
							</label>
						</div>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>

<script>
	$(document).ready(function() {
		var editor = new UE.ui.Editor();  
	    editor.render("container");
	    
		//增加模拟框拖动效果
		$(".modal").draggable({
			handle : ".modal-header"
		});

	});

</script>